package com.version.manager.util;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 查询参数
 */
public class QueryParam extends LinkedHashMap<String,Object> {
    private static final long serialVersionUID=1L;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    private int page;
    private int limit=10;
    public QueryParam(Map<String,Object> params){
        this.putAll(params);
        if(params.get("page")!=null){
            this.page=Integer.parseInt(params.get("page").toString());
        }
        if(params.get("limit")!=null){
            this.limit=Integer.parseInt(params.get("limit").toString());
        }
        this.remove("page");
        this.remove("limit");
    }

}
